﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Class GraphicCache
   | FastReport OpenSource Class Reference </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Class GraphicCache
   | FastReport OpenSource Class Reference ">
    <meta name="generator" content="docfx 2.45.1.0">
    
    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">
    
    
    
  </head>
  <body data-spy="scroll" data-target="#affix" data-offset="120">
    <div id="wrapper">
      <header>
        
        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              
              <a class="navbar-brand" href="../index.html">
                <img id="logo" class="svg" src="../logo.png" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
            </div>
          </div>
        </nav>
        
        <div class="subnav navbar navbar-default">
          <div class="container hide-when-search" id="breadcrumb">
            <ul class="breadcrumb">
              <li></li>
            </ul>
          </div>
        </div>
      </header>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="FastReport.GraphicCache">
  
  
  <h1 id="FastReport_GraphicCache" data-uid="FastReport.GraphicCache" class="text-break">Class GraphicCache
  </h1>
  <div class="markdown level0 summary"><p>Represents a cache of graphics objects such as pens, brushes, fonts and text formats.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><span class="xref">System.Object</span></div>
    <div class="level1"><span class="xref">GraphicCache</span></div>
  </div>
  <div classs="implements">
    <h5>Implements</h5>
    <div><span class="xref">System.IDisposable</span></div>
  </div>
  <div class="inheritedMembers">
    <h5>Inherited Members</h5>
    <div>
      <span class="xref">System.Object.ToString()</span>
    </div>
    <div>
      <span class="xref">System.Object.Equals(System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.GetHashCode()</span>
    </div>
    <div>
      <span class="xref">System.Object.GetType()</span>
    </div>
    <div>
      <span class="xref">System.Object.MemberwiseClone()</span>
    </div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="FastReport.html">FastReport</a></h6>
  <h6><strong>Assembly</strong>: FastReport.OpenSource.dll</h6>
  <h5 id="FastReport_GraphicCache_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class GraphicCache : IDisposable</code></pre>
  </div>
  <h5 id="FastReport_GraphicCache_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>Cache holds all used graphics objects. There is no need to dispose objects returned
by GetXXX calls.</p>
</div>
  <h5 id="FastReport_GraphicCache_examples"><strong>Examples</strong></h5>
  <p>This example demonstrates how to use graphic cache.</p>
<pre><code>public void Draw(FRPaintEventArgs e)
{
  Brush brush = e.Cache.GetBrush(BackColor);
  Pen pen = e.Cache.GetPen(BorderColor, 1, BorderStyle);
  e.Graphics.FillRectangle(brush, Bounds);
  e.Graphics.DrawRectangle(pen, Bounds);
}</code></pre>

  <h3 id="constructors">Constructors
  </h3>
  
  
  <a id="FastReport_GraphicCache__ctor_" data-uid="FastReport.GraphicCache.#ctor*"></a>
  <h4 id="FastReport_GraphicCache__ctor" data-uid="FastReport.GraphicCache.#ctor">GraphicCache()</h4>
  <div class="markdown level1 summary"><p>Initializes a new instance of the <strong>GraphicCache</strong> class with default settings.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public GraphicCache()</code></pre>
  </div>
  <h3 id="methods">Methods
  </h3>
  
  
  <a id="FastReport_GraphicCache_Dispose_" data-uid="FastReport.GraphicCache.Dispose*"></a>
  <h4 id="FastReport_GraphicCache_Dispose" data-uid="FastReport.GraphicCache.Dispose">Dispose()</h4>
  <div class="markdown level1 summary"><p>Disposes resources used by this object.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void Dispose()</code></pre>
  </div>
  
  
  <a id="FastReport_GraphicCache_GetBrush_" data-uid="FastReport.GraphicCache.GetBrush*"></a>
  <h4 id="FastReport_GraphicCache_GetBrush_Color_" data-uid="FastReport.GraphicCache.GetBrush(Color)">GetBrush(Color)</h4>
  <div class="markdown level1 summary"><p>Gets a brush with specified color.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public SolidBrush GetBrush(Color color)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">Color</span></td>
        <td><span class="parametername">color</span></td>
        <td><p>Color of a brush.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">SolidBrush</span></td>
        <td><p>The <strong>SolidBrush</strong> object.</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="FastReport_GraphicCache_GetFont_" data-uid="FastReport.GraphicCache.GetFont*"></a>
  <h4 id="FastReport_GraphicCache_GetFont_System_String_System_Single_FontStyle_" data-uid="FastReport.GraphicCache.GetFont(System.String,System.Single,FontStyle)">GetFont(String, Single, FontStyle)</h4>
  <div class="markdown level1 summary"><p>Gets a font with specified settings.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Font GetFont(string name, float size, FontStyle style)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">name</span></td>
        <td><p>Name of a font.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Single</span></td>
        <td><span class="parametername">size</span></td>
        <td><p>Size of a font.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">FontStyle</span></td>
        <td><span class="parametername">style</span></td>
        <td><p>Style of a font.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">Font</span></td>
        <td><p>The <strong>Font</strong> object.</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="FastReport_GraphicCache_GetPen_" data-uid="FastReport.GraphicCache.GetPen*"></a>
  <h4 id="FastReport_GraphicCache_GetPen_Color_System_Single_DashStyle_" data-uid="FastReport.GraphicCache.GetPen(Color,System.Single,DashStyle)">GetPen(Color, Single, DashStyle)</h4>
  <div class="markdown level1 summary"><p>Gets a pen with specified settings.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Pen GetPen(Color color, float width, DashStyle style)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">Color</span></td>
        <td><span class="parametername">color</span></td>
        <td><p>Color of a pen.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Single</span></td>
        <td><span class="parametername">width</span></td>
        <td><p>Width of a pen.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">DashStyle</span></td>
        <td><span class="parametername">style</span></td>
        <td><p>Dash style of a pen.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">Pen</span></td>
        <td><p>The <strong>Pen</strong> object.</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="FastReport_GraphicCache_GetPen_" data-uid="FastReport.GraphicCache.GetPen*"></a>
  <h4 id="FastReport_GraphicCache_GetPen_Color_System_Single_DashStyle_LineJoin_" data-uid="FastReport.GraphicCache.GetPen(Color,System.Single,DashStyle,LineJoin)">GetPen(Color, Single, DashStyle, LineJoin)</h4>
  <div class="markdown level1 summary"><p>Gets a pen with specified settings.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Pen GetPen(Color color, float width, DashStyle style, LineJoin lineJoin)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">Color</span></td>
        <td><span class="parametername">color</span></td>
        <td><p>Color of a pen.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Single</span></td>
        <td><span class="parametername">width</span></td>
        <td><p>Width of a pen.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">DashStyle</span></td>
        <td><span class="parametername">style</span></td>
        <td><p>Dash style of a pen.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">LineJoin</span></td>
        <td><span class="parametername">lineJoin</span></td>
        <td><p>Line join of a pen.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">Pen</span></td>
        <td><p>The <strong>Pen</strong> object.</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="FastReport_GraphicCache_GetStringFormat_" data-uid="FastReport.GraphicCache.GetStringFormat*"></a>
  <h4 id="FastReport_GraphicCache_GetStringFormat_StringAlignment_StringAlignment_StringTrimming_StringFormatFlags_System_Single_System_Single_" data-uid="FastReport.GraphicCache.GetStringFormat(StringAlignment,StringAlignment,StringTrimming,StringFormatFlags,System.Single,System.Single)">GetStringFormat(StringAlignment, StringAlignment, StringTrimming, StringFormatFlags, Single, Single)</h4>
  <div class="markdown level1 summary"><p>Gets a string format with specified settings.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public StringFormat GetStringFormat(StringAlignment align, StringAlignment lineAlign, StringTrimming trimming, StringFormatFlags flags, float firstTab, float tabWidth)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">StringAlignment</span></td>
        <td><span class="parametername">align</span></td>
        <td><p>Text alignment information on the vertical plane.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">StringAlignment</span></td>
        <td><span class="parametername">lineAlign</span></td>
        <td><p>Line alignment on the horizontal plane.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">StringTrimming</span></td>
        <td><span class="parametername">trimming</span></td>
        <td><p><strong>StringTrimming</strong> enumeration.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">StringFormatFlags</span></td>
        <td><span class="parametername">flags</span></td>
        <td><p><strong>StringFormatFlags</strong> enumeration that contains formatting information.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Single</span></td>
        <td><span class="parametername">firstTab</span></td>
        <td><p>The number of spaces between the beginning of a line of text and the first tab stop.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Single</span></td>
        <td><span class="parametername">tabWidth</span></td>
        <td><p>Distance between tab stops.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">StringFormat</span></td>
        <td><p>The <strong>StringFormat</strong> object.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="implements">Implements</h3>
  <div>
      <span class="xref">System.IDisposable</span>
  </div>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <div class="contribution">
                <ul class="nav">
                </ul>
              </div>
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
              <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            
            <span>Generated by <strong>DocFX</strong></span>
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../styles/docfx.js"></script>
    <script type="text/javascript" src="../styles/main.js"></script>
  </body>
</html>
